package cn.ante.ymcc.web.controller;

import cn.ante.ymcc.result.JSONResult;
import cn.ante.ymcc.service.ICreateTokenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class CreateTokenController {
    @Autowired
    private ICreateTokenService createTokenService;

    @GetMapping("/createToken/{courseId}")
    public JSONResult getToken(@PathVariable("courseId") String courseId){
        return JSONResult.success(createTokenService.getToken(courseId));
    }
}
